Ext.define('Admin.view.trade.AgreementMenuController', {
	        extend : 'Admin.app.BaseController',
	        alias : 'controller.agreementmenu',

	        onClearData : function() {
		        var me = this, vm = me.getViewModel();
		        var items = me.getView().items.items;
		        Ext.each(items, function(item) {
			                if (item.getStore) {
				                item.getStore().proxy.extraParams = {};
				                item.getStore().removeAll();
			                }
		                });
		        vm.set('listRecord', null);
	        },

	        onRecordChange : function(record) {
		        var me = this, vm = me.getViewModel();
		        vm.set('listRecord', record);
		        var activeTab = me.getView().getActiveTab();
		        if (activeTab && record) {
			        activeTab.fireEvent('refresh', activeTab, record);
		        }
	        },

	        onTabChange : function(tabPanel, newCard, oldCard, eOpts) {
		        var me = this, vm = me.getViewModel(), record = vm.get('listRecord');
		        record && newCard.fireEvent('refresh', newCard, record);
	        },

	        onDefaultRefresh : function(view, record) {
		        var me = this, vm = me.getViewModel();
				var store = view.getStore();
				store.proxy.extraParams = {
					id : record.data.id
				}
				store.reload();
	        },

	        onSaveProperty : function(btn) {
		        // var me = this, vm = me.getViewModel();
		        // var store = vm.getStore('tradeBidStore');
		        // var modified = store.getModifiedRecords();
		        // if (modified.length === 0) {
		        // return;
		        // }
		        // var datas = [];
		        // Ext.each(modified, function(record) {
		        // data = {
		        // id : record.data.id,
		        // price : record.data.price,
		        // value : record.data.value
		        // }
		        // datas.push(data);
		        // });
		        // Admin.Ajax.request({
		        // mask : btn.ownerCt.ownerCt,
		        // method : 'PUT',
		        // url : 'rest/api/tradebid/saves',
		        // params : Ext.encode(datas),
		        // fnSuccess : function() {
		        // store.commitChanges();
		        // }
		        // })

	        }
        });